<?php

namespace App\Criteria\Clbum\Clbum;

use App\Libs\Tools\DataTables;
use Illuminate\Support\Facades\Input;
use Prettus\Repository\Contracts\CriteriaInterface;
use Prettus\Repository\Contracts\RepositoryInterface;

class ClbumExtBaseQueryCriteria implements CriteriaInterface{

    public function apply($model, RepositoryInterface $repository){
        $model=$model->leftJoin('system_code', function ($join) {
            $join->on('system_code.type', '=', 'clbum_ext.system_code_type')
                 ->on('system_code.value', '=', 'clbum_ext.system_code_value');
        })->select('clbum_ext.*','system_code.value_name as system_code_value_name');
        return $model;
    }
}
